using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Protocol;
using MicroMsg.Resource.@string;
using MicroMsg.Scene;
using MicroMsg.Storage;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Windows.Media.Imaging;
namespace MicroMsg.Plugin.TXQQMail
{
	public class TXQQMail : PluginBase
	{
		private const string TAG = "TXQQMail";
		public const string PluginKey = "Plugin TXQQMail";
		public const long PluginID = 32786L;
		public const string PluginName = "TXQQMail";
		public const int PluginVersion = 256;
		private static TXQQMail mInstance;
		public override string mTitle
		{
			get
			{
				return strings.Plugin_qqmail_title;
			}
		}
		public override BitmapSource mIcon
		{
			get
			{
				return ImageCacheMgr.loadFromRes("Source/Plugin/QQMail/Resource/icon.png");
			}
		}
		public override BitmapSource mIconHD
		{
			get
			{
				return HeadImgMgr.getHeadImage("qqmail", true);
			}
		}
		public override BitmapSource mIconInList
		{
			get
			{
				return this.mIcon;
			}
		}
		public override string mDescription
		{
			get
			{
				return strings.Plugin_qqmail_hint;
			}
		}
		public override string mAuthor
		{
			get
			{
				return "tencent";
			}
		}
		public TXQQMail()
		{
			this.mKey = "Plugin TXQQMail";
			this.mID = 32786L;
			this.mName = "TXQQMail";
			this.mVersion = 256;
			this.mUserName = ConstantValue.TAG_QQMAIL;
			this.mIndexInTab = (MainTabIndex)3;
			this.mIndexInGroup = 2;
			this.mIndexInPosition = 0;
			this.mProtocolPluginFlag = EPluginFlag.MM_QQMAIL_UNINSTALL;
			this.mDefaultInstalled = true;
			TXQQMail.mInstance = this;
			Account curAccount = AccountMgr.getCurAccount();
			if (curAccount.nBindQQ <= 0u)
			{
				this.mEnabled = false;
			}
		}
		public override PluginSettingBaseCtrl GetPluginSettingCtrl()
		{
			return new QQMailPluginSetCtrl();
		}
		public static TXQQMail getInstance()
		{
			return TXQQMail.mInstance;
		}
		public override void onRegisterResult(RetConst retConst_0, int code)
		{
			Log.smethod_4("TXQQMail", string.Concat(new object[]
			{
				"on register result , ret = ",
				retConst_0,
				", code = ",
				code
			}));
		}
		public override bool onInitialize()
		{
			Log.smethod_4("TXQQMail", "initialize. ");
			PushMailServiceSenter.init();
			return true;
		}
		public override bool onInstalled(InstallMode mode)
		{
			Log.smethod_4("TXQQMail", "on inistalled. ");
			return true;
		}
		public override bool onUninstalled(InstallMode mode)
		{
			Log.smethod_4("TXQQMail", "on uninstalled. ");
			QQMailMgr.MailMsgClearAll();
			return true;
		}
		public override bool onParseChatMsg(ChatMsg chatMsg)
		{
			return false;
		}
		public override object execute(int entryType, object args)
		{
			Log.smethod_4("TXQQMail", "plugin execute,   entrytype =" + entryType);
			if (entryType == 2)
			{
				ToolFunction.GotoPageForUserControl("/Source/Plugin/QQMail/UI/QQMailSessionView.xaml", null, false);
			}
			return null;
		}
	}
}
